<%-- 
    Document   : error
    Created on : Oct 6, 2012, 5:54:53 PM
    Author     : natz
--%>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page import="com.myapp.actions.visit.ListVisits"%>
<%@page import="com.myweb.MyWeb"%>
<%@include file="../../commons/vars.jsp" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="mw" uri="/WEB-INF/tlds/myweb" %>
<mw:action action="<%=new ListVisits()%>" result="result"/>
<c:choose>
  <c:when test="${result.size() > 0}" >
    <table id="visit-list" class="table table-bordered table-hover">
      <tr class="header-row">
        <th>Visit ID</th>
        <th>Client Last Name</th>
        <th>Client First Name</th>
        <th>Reason for Consult</th>
        <th>Visit Time</th>
      </tr>
      <c:forEach items="${result}" var="visit">
        <tr data-id="${visit.id}">
          <td>${visit.id}</td>
          <td>${visit.client.lastName}</td>
          <td>${visit.client.firstName}</td>
          <td>${visit.reasonForConsult}</td>
          <td><fmt:formatDate 
            timeZone="${user.timeZoneObj}" 
            value="${visit.visitTime}" 
            pattern="yyyy-MM-dd / HH:mm"/></td>
        </tr>
      </c:forEach>
    </table>
  </c:when>
  <c:otherwise>
    <div class="alert">
      <button type="button" class="close" data-dismiss="alert">×</button>
      <strong>Warning!</strong> No data
    </div>
  </c:otherwise>
</c:choose>

